import Reflux from 'reflux';
import PageConst from './PageConst';
import Actions from './Actions';

export default Reflux.createStore({
    listenables: [Actions],
    data: {
        ...PageConst
    },

    onFetch: function (params, cb) {
        let t = this;
        t.updateComponent();
        cb && cb(t.data);
    },

    updateComponent: function () {
        this.trigger(this.data);
    },

    getInitialState: function () {
        return this.data;
    }
});
